#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__author__ = "wqk151"
__name__="admin"
__date__="2016/6/26"
__time__="18:02"
"""

from utility.sql_helper import MySqlHelper
# model 目录下一张表定义成一个类 一张表一个文件  一个类一个文件
# 只能调用utility里的helper方法

class Admin(object):
    def __init__(self):
        self.__helper = MySqlHelper()
    def Get_One(self,id):
        sql = "select * from admin where id =%s"
        params =(id,)
        return  self.__helper.GetOnet(sql,params)
    def CheckValidate(self,username,password):
        sql = 'select * from admin where name=%s and password=%s'
        params = (username,password)
        return self.__helper.Get_One(sql,params)